package com.cqie.secondhandtransaction.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

import com.cqie.secondhandtransaction.utils.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 
 * </p>
 *
 * @author gdy
 * @since 2025-02-10
 */
@Getter
@Setter
@TableName("order_info")
@ApiModel(value = "OrderInfo对象", description = "")
public class OrderInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("交易ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("订单编号")
    private String orderCode;

    @ApiModelProperty("买家id")
    private Integer userId;

    @ApiModelProperty("卖家id")
    private Integer sallerId;

    @ApiModelProperty("商品id")
    private Integer productId;

    @ApiModelProperty("交易地点（收货地址）")
    private String ordAddress;

    @ApiModelProperty("实付款")
    private BigDecimal ordPrice;

    @ApiModelProperty("付款时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = DateUtil.DATETIME_FORMAT)
    private Date payTime;

    @ApiModelProperty("交易时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = DateUtil.DATETIME_FORMAT)
    private Date tradeTime;

    @ApiModelProperty("订单状态，PENDING, 待支付；PAID,支付完成")
    private String status;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = DateUtil.DATETIME_FORMAT)
    private Date createTime;

    @ApiModelProperty("逻辑删除，1-删除")
    @TableLogic
    private Integer isDelete;


}
